/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.rm.freedrawsample;

import java.util.ArrayList;

import org.junit.Test;

import com.rm.freedrawview.FreeDrawSerializableState;
import com.rm.freedrawview.ResizeBehaviour;
import com.rm.freedrawview.SystemUtils;

import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.app.Context;

import static org.junit.Assert.assertEquals;

/**
 * 功能描述.
 *
 * @author a
 * @version v
 * @since 22/11/16
 */
public class ExampleOhosTest {
    /**
     * testBundleName.
     */
    @Test
    public void testBundleName() {
        final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
        assertEquals("com.rm.freedrawsample", actualBundleName);
    }

    /**
     * testFreeDrawSerializableState.
     */
    @Test
    public void testFreeDrawSerializableState() {
        FreeDrawSerializableState freeDrawSerializableState = new FreeDrawSerializableState(
                new ArrayList<>(), new ArrayList<>(), 0, 0, 0, ResizeBehaviour.CLEAR, 0, 0);
        freeDrawSerializableState.toString();
    }

    /**
     * testResizeBehaviour
     */
    @Test
    public void testResizeBehaviour() {
        ResizeBehaviour clear = ResizeBehaviour.CLEAR;
        ResizeBehaviour fitXy = ResizeBehaviour.FIT_XY;
        ResizeBehaviour crop = ResizeBehaviour.CROP;
    }

    /**
     * testGetDisplayWidthInPx.
     */
    @Test
    public void testGetDisplayWidthInPx() {
        Context appContext = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        int displayWidthInPx = SystemUtils.getDisplayWidthInPx(appContext);
    }

    /**
     * testGetDisplayHightInPx.
     */
    @Test
    public void testGetDisplayHightInPx() {
        Context appContext = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        int displayHightInPx = SystemUtils.getDisplayHightInPx(appContext);
    }

    /**
     * testFp2px.
     */
    @Test
    public void testFp2px() {
        Context appContext = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        float vv = SystemUtils.fp2px(appContext, 100);
    }
}